package com.sell.controller;

import com.sell.service.SecKillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: lichujun
 * @date: 2018-08-26
 */
@RestController
@RequestMapping("/sec/kill")
public class SecKillController {

    @Autowired
    private SecKillService killService;

    @GetMapping("/query/{productId}")
    public String query(@PathVariable("productId") String productId) {
        return killService.query(productId);
    }

    @GetMapping("/order/{productId}")
    public String  order(@PathVariable("productId") String productId) {
        return killService.order(productId);
    }
}
